/**
 * @Project TMHSCFX
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Apr 14, 2011
 * @Createtime 11:55:02 AM
 */

package com.tmh.study.fAS3AMTM.chap5
{
	import flash.display.Sprite;
	import flash.events.Event;

	public class Ball extends Sprite
	{
		public var radius:Number;

		private var color:uint;

		public var vx:Number = 0;

		public var vy:Number = 0;

		public function Ball(radius:Number = 40, color:uint = 0xcc0000)
		{
			super();
			this.radius = radius;
			this.color = color;

			addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
		}

		private function addedToStageHandler(event:Event):void
		{
			initData();
		}

		public function initData():void
		{
			graphics.beginFill(color);
			graphics.drawCircle(0, 0, radius);
			graphics.endFill();
		}
	}
}